UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MeEZACpcmuMwFlXpnclK6z/k6ymY3Vrzp3nH4CrHmzA=' 
WHERE 
  key_id = 'd859424e5a0ee6903d2a8d4916f276f3b2c4bb289d3d70d23cf86f5d81e2c468' 
  AND (
    token = 'MeEZACpcmuMwFlXpnclK6z/k6ymY3Vrzp3nH4CrHmzA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031