UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v3+hglU4wu2ArlfJUCtGjEGOF6siUHTwOJ6vMSZ3Ams=' 
WHERE 
  key_id = '873aa0ec854a94fd560b28baa4df0f0f0737356c9a904bdd52d596034ff91ccd' 
  AND (
    token = 'v3+hglU4wu2ArlfJUCtGjEGOF6siUHTwOJ6vMSZ3Ams=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014