UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nM+AL6/3uhe2B5l8SbDSNr6L9b0RgH89lXrrq8WukHo=' 
WHERE 
  key_id = '8404bded286f7e6bedaeeacf5463dfa4b1366cdc69f4a04af17682fa75b8fa5a' 
  AND (
    token = 'nM+AL6/3uhe2B5l8SbDSNr6L9b0RgH89lXrrq8WukHo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026