UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/ePEx0qqUKrOEGKHQSiybbVoR0rTqxSOLIFKm64A8f0=' 
WHERE 
  key_id = '6e5ad91cbc22b341e5c8685b0b99f0f243e4c1318a5e7f4c3a3a79a98459d159' 
  AND (
    token = '/ePEx0qqUKrOEGKHQSiybbVoR0rTqxSOLIFKm64A8f0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038