UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UBKhgePg7oER32yl7e/mZvViqXfsJ5LaBynOZ+OD48M=' 
WHERE 
  key_id = '72f41680ef04d15f0831cfd3dfaa573476619a144e4aaed33f3ec2cae730009d' 
  AND (
    token = 'UBKhgePg7oER32yl7e/mZvViqXfsJ5LaBynOZ+OD48M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038