UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RlfPe4xpOEacxc26BcrZNJzCKwFrP70rxEcfA2OJDYw=' 
WHERE 
  key_id = '961c8522974c64f8e2a9f763248060b83f46897b71958c37d9b0cb57573410f9' 
  AND (
    token = 'RlfPe4xpOEacxc26BcrZNJzCKwFrP70rxEcfA2OJDYw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021