UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DZ/DWvC5EwfbWhJ7NfGIj0Og2VBxzKfTjMD+/yz9ugw='
WHERE
key_id = '602921cacd3085f20357bb183fb460dc14a01044a4c82a8cfbbc1d9c57a38f01'
AND (
token = 'DZ/DWvC5EwfbWhJ7NfGIj0Og2VBxzKfTjMD+/yz9ugw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)