UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tl8SwvJQESrQ+izErBHDgwAhIVlZLGnPneKMRl0e6kk=' 
WHERE 
  key_id = '7ea0b2aca1eb0aa1a8fe4463a68b224a1b703506fab8d3d1b5ca9ef32135d531' 
  AND (
    token = 'Tl8SwvJQESrQ+izErBHDgwAhIVlZLGnPneKMRl0e6kk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053