UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JMqUxemIzUkHdjXcnaj7eZHQzV2shRhV8NeRg/b7uR8=' 
WHERE 
  key_id = 'c2c02c00092e1d155aa04a7436eca1f0b1956c5dc1530229f94a66dfd802f410' 
  AND (
    token = 'JMqUxemIzUkHdjXcnaj7eZHQzV2shRhV8NeRg/b7uR8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047