UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HJMtS7F2qnqFtwB3mOR8TM0IzFnU/VNUGp5uCZsDkvE=' 
WHERE 
  key_id = 'c7385747f61f2c815bcfcad80f30ea0b7a91e74fc8c8df9a5b78cf847ae99742' 
  AND (
    token = 'HJMtS7F2qnqFtwB3mOR8TM0IzFnU/VNUGp5uCZsDkvE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037