UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'claOWnubsj+d9KMGGXY5OCKlwiXUYCy5CwTZxdzSmI0=' 
WHERE 
  key_id = 'c2c9a45f0ac60f648a0c42d3918196dbaeaae647d80aea3d89d58f4b0eeed36e' 
  AND (
    token = 'claOWnubsj+d9KMGGXY5OCKlwiXUYCy5CwTZxdzSmI0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037