UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CeAU4BIfGnEGa9eL0zrPSwH7XVFZkKFnRoMhCAVkT3s=' 
WHERE 
  key_id = 'e7f0bf6741fe0c11a9d4311b68fddf67851fa9c73d50f23f5cdfa12db54ef10f' 
  AND (
    token = 'CeAU4BIfGnEGa9eL0zrPSwH7XVFZkKFnRoMhCAVkT3s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028