UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z69NTyvpfq1kdRJbeba/R/wkSxrP7cRawMSlL9CmpFs=' 
WHERE 
  key_id = '247aca115c7c0bf302827cb11f55e1f2e697b1b30411a17858bd44b0f5955baa' 
  AND (
    token = 'z69NTyvpfq1kdRJbeba/R/wkSxrP7cRawMSlL9CmpFs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033