UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EMPMcwOpDlKJ+EyIqYIjiRPmF/gii3OfMmQTZUL167c=' 
WHERE 
  key_id = 'da87fde3a117228a791d03b595d254f9470bd9598585323bf6cd28721b3d147b' 
  AND (
    token = 'EMPMcwOpDlKJ+EyIqYIjiRPmF/gii3OfMmQTZUL167c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018