UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eTAe87ijyAIX/irQWjIiojgvq/FmtJNGjjG6YVovonQ=' 
WHERE 
  key_id = '4fd8f8da054a6317def91a52f9803ce3e9fa4cb2ad7b42cb774c14f48f9069c2' 
  AND (
    token = 'eTAe87ijyAIX/irQWjIiojgvq/FmtJNGjjG6YVovonQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029