UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MtJduYJ1R4SVO+r5jylQCjNIgFn+3Bvkj9cfQlsoktM='
WHERE
key_id = 'e3766195e5b6ee71c5b775cc81492d73af7b3ca84a52b7a9d6570d75abdc7b6d'
AND (
token = 'MtJduYJ1R4SVO+r5jylQCjNIgFn+3Bvkj9cfQlsoktM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)