UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2tbCvOO3osCBewC3vP49Xj8SuMjFY6ZkAsFxq8oD6LA=' 
WHERE 
  key_id = '25ce1ce1125e9c08e00a853faa90d5a90daadb49353a066a3d1d5fbb182b4648' 
  AND (
    token = '2tbCvOO3osCBewC3vP49Xj8SuMjFY6ZkAsFxq8oD6LA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043