UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WKxH+j6oOnEtmJrIJBlcoTvyQ6TyofGKhnqoq/etJDA='
WHERE
key_id = '1e384a0b872da5d9c74b797b4dfe24e45167072248e0e521c15e40f9d6762a88'
AND (
token = 'WKxH+j6oOnEtmJrIJBlcoTvyQ6TyofGKhnqoq/etJDA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)