UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dwnznPVEjOTADAqfheTxeKv7nRDC33nJ/6NjNWbOv40=' 
WHERE 
  key_id = '186dc201850a0666b94c6dfc4760b09c0ed97ddac76115913ef945651a37a94a' 
  AND (
    token = 'dwnznPVEjOTADAqfheTxeKv7nRDC33nJ/6NjNWbOv40=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038