UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xvPjqPcTRobBDNAqk9zAg08f5REcE/k+16BJfbK5BM0=' 
WHERE 
  key_id = 'ab766c252657243ed6ff346a14d7c8afca9bd3248810ecec18881e9233a3e7ff' 
  AND (
    token = 'xvPjqPcTRobBDNAqk9zAg08f5REcE/k+16BJfbK5BM0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028