UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/rROk+qsQIlBZXyMAsl27KvKG0xWofgfx+3rSGT6qMQ='
WHERE
key_id = 'd50bf1bf6af40599f1c971ccb2bcc99bec7fe72c79474b98067eb318d249b84a'
AND (
token = '/rROk+qsQIlBZXyMAsl27KvKG0xWofgfx+3rSGT6qMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)