UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JK7eeYxdit6BFAQuJgLL8SZTaGbPvo++Dj7q2eLdjC0='
WHERE
key_id = 'cb1c7ba5646a2b608615b126b4d6b2bf23a32308e4c34ff8057c0b534c21cc71'
AND (
token = 'JK7eeYxdit6BFAQuJgLL8SZTaGbPvo++Dj7q2eLdjC0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)