UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VPop0sy7fm77E9gz/DKG7Yc9/2U60Ai3OkOkrCinX6o=' 
WHERE 
  key_id = 'b05116f87d83424ebd796dbcf591cefce205ff407b70a9869d5f912c59e5622c' 
  AND (
    token = 'VPop0sy7fm77E9gz/DKG7Yc9/2U60Ai3OkOkrCinX6o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030