UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rosBih1cWA5rAPA3Ajl55zXIzSPNAE25LRdzFTQS8qQ=' 
WHERE 
  key_id = '0ce43319852672607760379d37744a947ad66f09e581dfd8652877ec620505b0' 
  AND (
    token = 'rosBih1cWA5rAPA3Ajl55zXIzSPNAE25LRdzFTQS8qQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023