UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jVvZijvwzDJOdoFxAi7o6c0e6K2SSDnUMqFYh84Z0lo='
WHERE
key_id = 'a57c408df2f16db56f4a979ea91ebb8d6caf82d7d55a693732de2ca71dbc0a5f'
AND (
token = 'jVvZijvwzDJOdoFxAi7o6c0e6K2SSDnUMqFYh84Z0lo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)