UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eTJTG3UO3qGtPWcQ4+bFO8tSWP8ZWPa+J/XZHZHbOwI='
WHERE
key_id = '7939823235fb6b1a898f61f78db9d883ab685b82d4a425faf99df64e9f8d2cb2'
AND (
token = 'eTJTG3UO3qGtPWcQ4+bFO8tSWP8ZWPa+J/XZHZHbOwI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)