UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6BIOJHEOK8kGjOFkmPEpd1ROE4GmjTP24fSt8Q3lRZo=' 
WHERE 
  key_id = '07ae2aa15294de1eb036460e3a6a84dd2f71f6af459828bbc2db80cb4c74d855' 
  AND (
    token = '6BIOJHEOK8kGjOFkmPEpd1ROE4GmjTP24fSt8Q3lRZo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045