UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cbDwA8OD3UC/RwS6NRwomD0DbQvNlS9dqTAOVC+yYII='
WHERE
key_id = '67be288ada6d0af4a099e5417c7973f60ab2b4b96d9d636472a81cd898aef70f'
AND (
token = 'cbDwA8OD3UC/RwS6NRwomD0DbQvNlS9dqTAOVC+yYII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)