UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nZoBuF1CZnUy0AHQDFXpMamzsZKE0sCPEXJfSljXEoQ='
WHERE
key_id = '935bb2a4250b62d59dcd1a636db3fdfce8b428a6a9ed3709ebda9629da5f0a8e'
AND (
token = 'nZoBuF1CZnUy0AHQDFXpMamzsZKE0sCPEXJfSljXEoQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)