UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jXgwY5EHSgVKKTh/k2lA2Iz87Aoqkw3oYkrGRmr4mdo='
WHERE
key_id = 'f4ece5a9c0be7442419b2e0586a30432060b1aff36943bc3ad7b1225b401403e'
AND (
token = 'jXgwY5EHSgVKKTh/k2lA2Iz87Aoqkw3oYkrGRmr4mdo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)